package com.sunday.boot3.user.center.provider.impl;

import com.sunday.boot3.user.center.pojo.dto.permissions.*;
import com.sunday.common.core.remoting.base.page.PageResultDTO;
import com.sunday.common.core.remoting.base.response.Response;
import com.sunday.boot3.user.center.controller.PermissionsController;
import com.sunday.boot3.user.center.provider.PermissionsProvider;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Collection;

/**
 * @Description: 权限表 provider impl 层
 * @author: zsy
 * @Create: 2024/09/22 16:24:39
 */
@Slf4j
@DubboService
@RequiredArgsConstructor
public class PermissionsProviderImpl implements PermissionsProvider {

    private final PermissionsController permissionsController;

    /**
     * @Description: 新增 权限表 数据
     * @Param: [savePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response save(SavePermissionsReqDTO savePermissionsReqDTO) {
        return permissionsController.save(savePermissionsReqDTO);
    }

    /**
     * @Description: 权限表 批量权限保存
     * @param saveBatchPermissionsReqDTO
     * @return
     */
    @Override
    public Response saveBatch(SaveBatchPermissionsReqDTO saveBatchPermissionsReqDTO) {
        return permissionsController.saveBatch(saveBatchPermissionsReqDTO);
    }

    /**
     * @Description: 删除 权限表 数据
     * @Param: [removePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response remove(RemovePermissionsReqDTO removePermissionsReqDTO) {
        return permissionsController.remove(removePermissionsReqDTO);
    }

    /**
     * @Description: 修改 权限表 数据
     * @Param: [updatePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response update(UpdatePermissionsReqDTO updatePermissionsReqDTO) {
        return permissionsController.update(updatePermissionsReqDTO);
    }

    /**
     * @Description: 获取 权限表 分页列表数据
     * @Param: [pagePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response<com.sunday.common.core.remoting.base.page.PageResultDTO<com.sunday.boot3.user.center.pojo.dto.permissions.PagePermissionsResDTO>>
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response<PageResultDTO<PagePermissionsResDTO>> page(PagePermissionsReqDTO pagePermissionsReqDTO) {
        return permissionsController.page(pagePermissionsReqDTO);
    }

    @Override
    public Response<Collection<ListPermissionsResDTO>> list() {
        return permissionsController.list();
    }

}